//
//  MZY_COM_textCell.m
//  FullHouse
//
//  Created by dllo on 16/1/29.
//  Copyright © 2016年 yy. All rights reserved.
//

#import "MZY_COM_textCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#define HORIZONTAL [UIScreen mainScreen].bounds.size.width / 414
#define VERTICAL [UIScreen mainScreen].bounds.size.height / 736

@implementation MZY_COM_textCell

- (void)dealloc
{
    [self.faceImageView release];
    [self.nameLabel release];
    [self.likeLabel release];
    [self.picImageView release];
    [self.rightImageView release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.faceImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.faceImageView];
    [self.faceImageView release];
    
    self.nameLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel release];
    
    self.likeLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.likeLabel];
    [self.likeLabel release];
    
    self.picImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.picImageView];
    [self.picImageView release];
    
    self.rightImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.rightImageView];
    [self.rightImageView release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.faceImageView.frame = CGRectMake(10 * HORIZONTAL, 10 * HORIZONTAL, 50 * HORIZONTAL, 50 * HORIZONTAL);
    self.nameLabel.frame = CGRectMake(70 * HORIZONTAL, 10 * VERTICAL, 250 * HORIZONTAL, 20 * VERTICAL);
    self.likeLabel.frame = CGRectMake(70 * HORIZONTAL, 40 * VERTICAL, 220 * HORIZONTAL, 20 * VERTICAL);
    self.rightImageView.frame = CGRectMake(WIDTH - 30 * HORIZONTAL, 25 * VERTICAL, 20 * HORIZONTAL, 20 * HORIZONTAL);
    self.picImageView.frame = CGRectMake(WIDTH - 90 * HORIZONTAL, 10 * VERTICAL, 50 * HORIZONTAL, 50 * HORIZONTAL);
}

@end
